home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 2.2 KB | 72 lines | [TEXT/GEOL] |
- Item 5381299 30-July-90 15:56PDT
-
- From: D4684 Robins Analytics, S Robins,PRT
-
- To: FARALLON.ENG Farallon, Engineering,PRT
-
- cc: MACAPP.TECH$ MacApp Technical
-
- Sub: Re: Page Setup & Dialog…
-
- Eric,
- I had to make my printing default to landscape also. There are two ways of
- doing it. At first I set the bit that is documented for imagewriters, but was
- assured by Keith Rollin that probably wasn't wise. He suggested the following
- code (or something similar, this is my implementation):
- PROCEDURE TReportPrintHandler.SetToLandscape;
-
- VAR
- dummy: boolean;
- printRecordHandle: THPrint;
-
- BEGIN
- printRecordHandle := THPrint(GetResource('prec', 1000));
- FailResError;
- THPrint(fHPrint)^^ := printRecordHandle^^;
- ValidatePrintRecord(dummy);
- CheckPrinter;
- ReleaseResource(Handle(printRecordHandle));
- END;
-
- The 'prec' resource is one I created myself in a dummy program (I believe I
- used DemoDialogs or something like that, you will want to override a print
- handler). Run the program and choose the page setup you want as the default and
- in TPrintHandler.PosePageSetup… put some code in to write the print record
- handle to a resource after the dialog is closed. Then use resedit to paste it
- somewhere you can use it in your regular program.
- As far as your second question goes. I have done a lot of things similar to
- what you mentioned. I would do it like this. Override the TDialogView that is
- the superview of the buttons and edit text. You don't need to override the
- buttons or edit text at all. In your TDialogView's DoChoice method do this:
-
- PROCEDURE TMyDialogView.DoChoice (origView: TView;
- itsChoice: integer);
- OVERRIDE;
-
- PROCEDURE ChangeTextEnable (enable: Boolean);
-
- BEGIN
- Disable or enable the edit text's as needed here
- END;
-
- BEGIN
- CASE itsChoice OF
- mRadioHit:
- BEGIN
- INHERITED DoChoice(origView, itsChoice);
- ChangeTextEnable(origView.fIdentifier = kSecondButtonID);
- END;
- OTHERWISE
- INHERITED DoChoice(origView,itsChoice);
- END
- END;
-
- Hope this helps,
-
- Doug Ahmann
- Robins Analytics
- St. Paul, MN 55104
-
-
-
-